﻿<Window x:Class="RemoteTestRunner.FormsUI.Wpf.Runner"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:RemoteTestRunner.FormsUI.Wpf"
        xmlns:contracts="clr-namespace:RemoteTestRunner.Contracts;assembly=RemoteTestRunner.Contracts" 
        xmlns:Converters="clr-namespace:RemoteTestRunner.FormsUI.Wpf.Converters" 
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        Title="Remote Test Runner" 
        Height="700" 
        Width="900" 
        WindowStartupLocation="CenterScreen" 
        ResizeMode="CanResize" 
        Icon="/RemoteTestRunner;component/Images/RTRLogo.png">
    <Window.Resources>
        <!--<Style x:Key="ToolbarIcons">-->
        <local:DataDrivenTestConverter x:Key="dataDrivenTestConverter" />
        <local:BooleanToHiddenVisibilityConverter x:Key="booleanToHiddenVisibilityConverter" />
        <Converters:BooleanConverter x:Key="booleanConverter" />

        <CollectionViewSource Source="{Binding Path=Projects}" x:Key="SortedProjects">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="Name"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>

        <CollectionViewSource Source="{Binding Path=SelectedProject.Tests}" x:Key="SortedTests">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="Name"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>

        <CollectionViewSource Source="{Binding Path=TestClassesAndMethods}" x:Key="SortedTestClassesAndMethods">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="Name"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>

        <Style x:Key="{x:Type StatusBarItem}" TargetType="{x:Type StatusBarItem}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type StatusBarItem}">
                        <Border
                            BorderBrush="LightSlateGray"
                            BorderThickness="2"
                            CornerRadius="2,2,2,2"
                            >
                            <ContentPresenter Margin="4,1,0,0"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type Image}" x:Key="toolbarImageStyle">
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                    <Setter Property="Opacity" Value="0.15"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style TargetType="{x:Type TabControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <Grid Margin="2,8,0,0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TabPanel 
                                Grid.Row="0"
                                Panel.ZIndex="1" 
                                Margin="0,0,0,0" 
                                IsItemsHost="True"
                                Background="Transparent" />
                            <Border 
                                Grid.Row="1"
                                BorderBrush="LightSlateGray" 
                                BorderThickness="2" 
                                CornerRadius="0, 6, 6, 6" >
                                <ContentPresenter ContentSource="SelectedContent" Margin="3,3,3,3" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type TabItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabItem}">
                        <Grid>
                            <Border  
             Name="Border"
             Background="LightSteelBlue"
             BorderBrush="Black" 
             BorderThickness="1,1,1,0"
             CornerRadius="6,6,0,0" >
                                <ContentPresenter x:Name="ContentSite"
               VerticalAlignment="Center"
               HorizontalAlignment="Center"
               ContentSource="Header"
               Margin="12,2,12,2"/>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="LightSteelBlue" />
                                <Setter TargetName="Border" Property="Margin" Value="0,0,0,-2" />
                                <Setter TargetName="Border" Property="BorderThickness" Value="2,2,2,0" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="LightSlateGray" />
                            </Trigger>
                            <Trigger Property="IsSelected" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="LightGray" />
                                <Setter TargetName="Border" Property="Margin" Value="0,0,0,0" />
                                <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="Black" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <DockPanel LastChildFill="True" Height="Auto" Width="Auto">
        <Menu DockPanel.Dock="Top" Grid.Row="0" Grid.ColumnSpan="2" Height="22" Name="menu1" VerticalAlignment="Top" >
            <MenuItem Header="_File">
                <MenuItem Header="_Open Test Results..." Command="{Binding OpenTestResultsCommand}" InputGestureText="Ctrl+O">
                    <MenuItem.Icon>
                        <Image VerticalAlignment="Center" Height="16" Source="Images/OpenFile.bmp" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator Margin="0, -4, 0, -3" />
                <!--<MenuItem Header="_Send E-Mail Notification"></MenuItem>
                <Separator Margin="0, -4, 0, -3" />-->
                <MenuItem Header="E_xit" Command="{Binding ExitCommand}"></MenuItem>
            </MenuItem >
            <MenuItem Header="_View">
                <MenuItem.Resources >
                    <CollectionViewSource Source="{Binding Path=DataSources}" x:Key="SortedDataSources">
                        <CollectionViewSource.SortDescriptions>
                            <scm:SortDescription PropertyName="Name" />
                            <scm:SortDescription PropertyName="DataTableName" />
                        </CollectionViewSource.SortDescriptions>
                    </CollectionViewSource>
                </MenuItem.Resources>
                <MenuItem Header="_Test Selection Pane" IsCheckable="True" IsChecked="{Binding Path=IsChecked, ElementName=chkCollapse}">
                    <MenuItem.Icon>
                        <Image Source="Images/Collapse.bmp" Height="16" Width="16" ToolTip="Show/Hide Test Selection" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="_Data-Driven Tests Only" IsCheckable="True" IsChecked="{Binding ShowDataDrivenOnly}">
                    <MenuItem.Icon>
                        <Image Source="Images/DataDrivenFilter.png" Height="16" Width="16" ToolTip="Show/Hide Non-Data-Drivent Tests" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator Margin="0, -4, 0, -3"/>
                    <MenuItem Header="_Data Sources" ItemsSource="{Binding Source={StaticResource SortedDataSources}}">
                    <MenuItem.ItemTemplate>
                        <DataTemplate>
                            <MenuItem  Command="{Binding DataContext.ViewDataSourceCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" CommandParameter="{Binding}" >
                                <MenuItem.Header>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Name}" />
                                        <TextBlock Text="." />
                                        <TextBlock Text="{Binding DataTableName}" />
                                    </StackPanel>
                                </MenuItem.Header>
                            </MenuItem>
                        </DataTemplate>
                    </MenuItem.ItemTemplate>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="_Tools">
                <MenuItem Header="Configure _Projects and Tests..." Command="{Binding ProjectAdminCommand}" >
                    <MenuItem.Icon>
                        <Image VerticalAlignment="Center" Height="16" Source="Images/ConfigureTests.bmp" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="_Delete Selected Test Run History" Command="{Binding DeleteSelectedHistoryItemsCommand}" InputGestureText="Del">
                    <MenuItem.Icon>
                        <Image Source="/RemoteTestRunner;component/Images/delete2.png" Height="16" Width="16" ToolTip="Delete Selected Test Run History" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator Margin="0, -4, 0, -3" />
                <MenuItem Header="_Options..." Command="{Binding ShowOptionsCommand}"></MenuItem>
            </MenuItem >
            <MenuItem Header="Te_st">
                <MenuItem Header="_Run" Command="{Binding RunCommand}">
                    <MenuItem.Icon>
                        <Image VerticalAlignment="Center" Height="16" Source="Images/Run.bmp" Style="{StaticResource toolbarImageStyle}" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator Margin="0, -4, 0, -3"/>
                <MenuItem Header="_Copy Test Details" IsEnabled="False"></MenuItem>
            </MenuItem>
            <MenuItem Header="_Help">
                <MenuItem Header="View _Help Topics On-line" Command="{Binding ShowHelpTopicsCommand}">
                    <MenuItem.Icon>
                        <Image VerticalAlignment="Center" Height="16" Source="Images/Help.bmp" Style="{StaticResource toolbarImageStyle}" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator Margin="0, -4, 0, -3" />
                <MenuItem Header="_About" Command="{Binding ShowAboutCommand}">
                </MenuItem>
            </MenuItem>
        </Menu>
        <ToolBarTray DockPanel.Dock="Top" Grid.Row="1" Grid.ColumnSpan="2">
            <ToolBar Name="toolBar1">
                <Button Command="{Binding OpenTestResultsCommand}" >
                    <Image Source="Images/Openfile.bmp" Height="16" Width="16" ToolTip="Open Test Results" />
                </Button>
                <Separator />
                <Button Command="{Binding RunCommand}" >
                    <Image Source="Images/Run.bmp" Style="{StaticResource toolbarImageStyle}" ToolTip="Run Tests" />
                </Button>
                <Button  Visibility="Collapsed" >
                    <Image Source="Images/Email.bmp" ToolTip="Send Results in E-mail" />
                </Button>
                <Separator />
                <Button Command="{Binding ProjectAdminCommand}" >
                    <Image Source="Images/ConfigureTests.bmp" ToolTip="Configure Projects and Tests" />
                </Button>
                <Separator />
                <CheckBox Name="chkCollapse" IsChecked="True" >
                    <Image Source="Images/Collapse.bmp" Height="16" Width="16" ToolTip="View Test Selection Pane" />
                </CheckBox>
                <CheckBox IsChecked="{Binding ShowDataDrivenOnly}">
                    <Image Source="Images/DataDrivenFilter.png" Height="16" Width="16" ToolTip="Show Data-Driven Tests Only" />
                </CheckBox>
            </ToolBar>
        </ToolBarTray>
        <Grid Height="Auto" Margin="0" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="{Binding  Path=IsChecked, ElementName=chkCollapse, Converter={StaticResource booleanConverter}, ConverterParameter='1*,0'}" />
                <ColumnDefinition Width="3*" />
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" Grid.Row="0" Margin="0,0,7,0" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <DockPanel Grid.Row="0" LastChildFill="True" Margin="0,0,-4,8" MinHeight="160" >
                    <GroupBox DockPanel.Dock="Top" Header="Test Selection" >
                        <StackPanel >
                            <Label >Project:</Label>
                            <ComboBox ItemsSource="{Binding Source={StaticResource SortedProjects}}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" SelectedValue="{Binding Path=SelectedProject}" ></ComboBox>
                            <!--<ComboBox ItemsSource="{Binding Path=Projects}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" SelectedValue="{Binding Path=SelectedProject}" ></ComboBox>-->
                            <Label >Test:</Label>
                            <ComboBox ItemsSource="{Binding Source={StaticResource SortedTests}}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" SelectedValue="{Binding Path=SelectedTest}" ></ComboBox>
                            <!--<ComboBox ItemsSource="{Binding Path=SelectedProject.Tests}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" SelectedValue="{Binding Path=SelectedTest}" ></ComboBox>-->
                        </StackPanel>
                    </GroupBox>
                    <GroupBox Header="Test Classes and Methods" BorderThickness="2">
                        <TreeView Name="tvwClassesAndMethods" BorderThickness="0" Background="{x:Null}">
                            <TreeViewItem ItemsSource="{Binding Source={StaticResource SortedTestClassesAndMethods}}" IsExpanded="True" >
                                <TreeViewItem.Header>
                                    <StackPanel Orientation="Horizontal" >
                                        <CheckBox IsChecked="{Binding AllClassesAndMethodsSelected}" ></CheckBox>
                                        <Image Source="Images/All.bmp"/>
                                        <Label Padding="0">All Classes and Methods</Label>
                                    </StackPanel>
                                </TreeViewItem.Header>
                                <TreeViewItem.ItemTemplate>
                                    <DataTemplate>
                                        <TreeViewItem ItemsSource="{Binding TestMethods}" IsExpanded="True">
                                            <TreeViewItem.Header>
                                                <StackPanel Orientation="Horizontal" >
                                                    <CheckBox IsChecked="{Binding IsSelected}" IsEnabled="{Binding IsTestable}"></CheckBox>
                                                    <Image Source="Images/Class.bmp"/>
                                                    <Label Padding="0" Content="{Binding Name}"></Label>
                                                </StackPanel>
                                            </TreeViewItem.Header>
                                            <TreeViewItem.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Horizontal" >
                                                        <CheckBox IsChecked="{Binding IsSelected}" IsEnabled="{Binding IsTestable}"></CheckBox>
                                                        <Image Source="{Binding Path=DataDriven, Converter={StaticResource dataDrivenTestConverter}}" />
                                                        <Label Padding="0" Content="{Binding Name}"></Label>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </TreeViewItem.ItemTemplate>
                                        </TreeViewItem>
                                    </DataTemplate>
                                </TreeViewItem.ItemTemplate>
                            </TreeViewItem>
                        </TreeView>
                    </GroupBox>
                </DockPanel>
                <GridSplitter Grid.Row="0" Height="4" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" ClipToBounds="False" Focusable="False" IsTabStop="False" Background="#81DCDCDC" Margin="0,0,-4,0"></GridSplitter>
                <DockPanel Grid.Row="1" LastChildFill="True" >
                    <GroupBox Header="Test Run History"  BorderThickness="2" Margin="1,0,-4,-2">
                        <!--IsSelected="IsSelected"  DisplayMemberPath="Item.TestRunName" SelectedValue="{Binding Path=TestResultSummary, Mode=TwoWay}"  IsSelected="{Binding IsSelected}"-->
                        <!--<StackPanel>-->
                        <!--<ListBox Name="lstTestRunHistory" MinHeight="40" ItemsSource="{Binding TestResultHistory}" SelectionMode="Extended" >
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <ListBoxItem Content="{Binding Item.TestRunName}" />
                                        <TextBlock Text="{Binding Item.TestRunName}" ></TextBlock>
                                        <CheckBox Content="{Binding Item.TestRunName}" IsChecked="{Binding IsSelected}"></CheckBox>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>-->
                        <ListBox MinHeight="40" ItemsSource="{Binding TestResultHistory}" DisplayMemberPath="Item.TestRunName" SelectedValue="{Binding Path=TestResultSummary, Mode=TwoWay}" SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemStyle1}" BorderThickness="0" Background="{x:Null}">
                            <ListBox.Resources>
                                <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
                                    <!--<Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                                    <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                                    <Setter Property="Padding" Value="2,0,0,0"/>-->
                                    <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                                    <!--<Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                                <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsSelected" Value="true">
                                                        <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                                                    </Trigger>
                                                    <MultiTrigger>
                                                        <MultiTrigger.Conditions>
                                                            <Condition Property="IsSelected" Value="true"/>
                                                            <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                                        </MultiTrigger.Conditions>
                                                        <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                                                    </MultiTrigger>
                                                    <Trigger Property="IsEnabled" Value="false">
                                                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>-->
                                </Style>
                            </ListBox.Resources>
                        </ListBox>
                        <!--</StackPanel>-->
                    </GroupBox>
                </DockPanel>
            </Grid>
            <GridSplitter Grid.Column="0" Width="4" VerticalAlignment="Stretch"
                          Visibility="{Binding Path=IsChecked, ElementName=chkCollapse, Converter={StaticResource booleanToHiddenVisibilityConverter}}" IsTabStop="False" Focusable="False" Background="#81DCDCDC" />
            <DockPanel Grid.Column="1" Margin="0,0,0,0" LastChildFill="True">
                <GroupBox DockPanel.Dock="Top" Header="Test Information" DataContext="{Binding SelectedTest}" 
                          Visibility="{Binding Path=IsChecked, ElementName=chkCollapse, Converter={StaticResource booleanToHiddenVisibilityConverter}}" BorderThickness="2"  Margin="0,0,2,0" Background="{x:Null}">
                    <Grid Name="grdTestInfoDetails">
                        <Grid.Resources>
                            <Style TargetType="Label" >
                                <Setter Property="Padding" Value="3,2" />
                            </Style>
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions >
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Label Content="Assembly Path:" Grid.Row="0" Grid.Column="0" />
                        <Label Content="Configuration Path:" Grid.Row="1" Grid.Column="0"/>
                        <Label Content="Run Configuration Path:" Grid.Row="2" Grid.Column="0"/>
                        <TextBox Grid.Row="0" Grid.Column="1" IsReadOnly="True" Text="{Binding Path=AssemblyPath}" BorderThickness="0" Background="{x:Null}" Margin="0,4,0,0" Foreground="Navy" />
                        <TextBox Grid.Row="1" Grid.Column="1" IsReadOnly="True" Text="{Binding Path=ConfigPath}" BorderThickness="0" Background="{x:Null}" Margin="0,4,0,0" Foreground="Navy" />
                        <TextBox Grid.Row="2" Grid.Column="1" IsReadOnly="True" Text="{Binding Path=RunConfigPath}" BorderThickness="0" Background="{x:Null}" Margin="0,4,0,0" Foreground="Navy" />
                    </Grid>
                </GroupBox>
                <TabControl DataContext="{Binding Path=TestResult}" BorderBrush="LightSlateGray" Margin="0,0,4,0">
                    <TabItem Header="Test Run Result Summary" >
                        <DockPanel LastChildFill="True" Name="pnlTestResults" >
                            <Grid DockPanel.Dock="Top" Margin="1" >
                                <Grid.Resources>
                                    <Style TargetType="Label" >
                                        <Setter Property="Padding" Value="10,2,2,2" />
                                    </Style>
                                </Grid.Resources>
                                <Grid.ColumnDefinitions >
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0" Padding="2,2,2,2" Content="Total:"></Label>
                                <Label Grid.Column="1" Content="{Binding Path=TotalCount}" Foreground="Navy"></Label>
                                <Label Grid.Column="2">Executed:</Label>
                                <Label Grid.Column="3" Content="{Binding Path=TotalExecuted}" Foreground="Navy"></Label>
                                <Label Grid.Column="4" >Passed:</Label>
                                <Label Grid.Column="5" Content="{Binding Path=TotalPassed}" Foreground="Navy"></Label>
                                <Label Grid.Column="6" >Failed:</Label>
                                <Label Grid.Column="7" Content="{Binding Path=TotalFailed}" Foreground="Navy"></Label>
                                <Label Grid.Column="8" >Timed Out:</Label>
                                <Label Grid.Column="9" Content="{Binding Path=TotalTimedOut}" Foreground="Navy"></Label>
                                <Label Grid.Column="10" >Inconclusive:</Label>
                                <Label Grid.Column="11" Content="{Binding Path=TotalInconclusive}" Foreground="Navy"></Label>
                            </Grid>
                            <TreeView ItemsSource="{Binding Path=TestResults}" BorderThickness="0" Background="{x:Null}">
                                <TreeView.Resources>
                                    <local:ResultImageSourceConverter x:Key="resultImageSourceConverter"></local:ResultImageSourceConverter>
                                    <Converters:TestResultColumnWidthConverter x:Key="testResultColumnWidthConverter" />
                                    <local:TestResultDescriptionConverter x:Key="testResultDescriptionConverter" />

                                    <HierarchicalDataTemplate DataType="{x:Type contracts:TestResultInfo}"
                                                              ItemsSource="{Binding DataDrivenResults}">
                                        <StackPanel Orientation="Horizontal" >
                                            <Image Source="{Binding Converter={StaticResource resultImageSourceConverter}}"></Image>
                                            <TextBlock Text="{Binding Converter={StaticResource testResultDescriptionConverter}}" 
                                                       Width="{Binding Converter={StaticResource testResultColumnWidthConverter}}"
                                                       ToolTip="{Binding Converter={StaticResource testResultDescriptionConverter}}"></TextBlock>
                                            <TextBlock Text="{Binding Path=Message}" ToolTip="{Binding Path=Message}"></TextBlock>
                                        </StackPanel>

                                        <!--<HierarchicalDataTemplate.-->

                                    </HierarchicalDataTemplate>

                                </TreeView.Resources>

                                <!--<TreeView.ItemTemplate>
                                    <HierarchicalDataTemplate>
                                        <StackPanel Orientation="Horizontal" >
                                            <TextBlock Width="200" Text="{Binding Path=MethodName}"></TextBlock>
                                            <TextBlock Text="{Binding Path=Message}"></TextBlock>
                                        </StackPanel>
                                    </HierarchicalDataTemplate>
                                </TreeView.ItemTemplate>-->

                            </TreeView>
                        </DockPanel>
                    </TabItem>
                    <TabItem Header="Details">
                        <WebBrowser Name="detailedTestResults"></WebBrowser>
                    </TabItem>
                </TabControl>
            </DockPanel>
            <StatusBar Grid.Row="1" Height="23" Name="sbStatus" Grid.ColumnSpan="2">
                <StatusBarItem Content="{Binding Status}" BorderThickness="2" BorderBrush="LightSlateGray" Margin="4,0" />
            </StatusBar>
        </Grid>
    </DockPanel>
</Window>
